//
//  ContacterCell.m
//  ChengXinBao
//
//  Created by RongZhou on 17/3/6.
//  Copyright © 2017年 RongZhou. All rights reserved.
//

#import "ContacterCell.h"
#import "PPPersonModel.h"
@implementation ContacterCell


-(void)setModel:(PPPersonModel *)model{
    _model = model;
    _iconImageView.image = model.headerImage ? model.headerImage : [UIImage imageNamed:@"defult"];
   [self setcoridinesAboutImageView:self.iconImageView];
    self.nameLabel.text = model.name;
}

/**
 *  设置imageview的圆角
 *
 *  @param imageView
 */
-(void)setcoridinesAboutImageView:(UIImageView *)
imageView{
    UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:imageView.bounds byRoundingCorners:UIRectCornerAllCorners cornerRadii:imageView.bounds.size];
    CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init];
    maskLayer.frame = imageView.bounds;
    maskLayer.path = maskPath.CGPath;
    imageView.layer.mask = maskLayer;
}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
